<template>
  <div ref="searchRef" class="common-search-view">
    <t-form ref="formRef" :data="formData" :colon="true" layout="inline" :label-width="0">
      <form-item v-for="(item, index) in list" :key="index" :form-data="formData" :data="item"></form-item>
      <div class="opt">
        <div class="item">
          <t-button class="common-button" theme="primary">搜索</t-button>
          <t-button class="common-button" variant="outline">重置</t-button>
        </div>
        <div class="item">
          <t-button class="common-button icon" theme="primary">
            <template #icon><svg-icon name="icon"></svg-icon> </template>
          </t-button>
          <t-button class="common-button icon" theme="primary">
            <template #icon><svg-icon name="icon"></svg-icon> </template>
          </t-button>
        </div>
      </div>
    </t-form>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue';

const INIT_DATA = { sn: '', dev_name__like: '' };

const list = ref([
  { label: '', value: '', key: 'sn', type: 'InputView', placeholder: '请输入设备序列号', clearable: true },
  { label: '', value: '', key: 'dev_name__like', type: 'InputView', placeholder: '请输入设备名称', clearable: true },
]);

const formData = ref({ ...INIT_DATA });
</script>

<style scoped></style>
